package com.vavr.checkincms.domain;

import java.time.LocalDateTime;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * CheckInRangeConfig
 *
 * @since 2024.08
 */
@Getter
@Setter
public class CheckInRangeConfig {
    /**
     * 签到时间范围集合
     */
    private List<CheckInRange> checkInRanges;

    /**
     * 签到时间范围
     */
    @Getter
    @Setter
    public static class CheckInRange {
        /**
         * 开始时间
         */
        @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        private LocalDateTime startTime;

        /**
         * 结束时间
         */
        @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
        @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
        private LocalDateTime endTime;
    }
}
